<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <p>
        <button onclick="changeFrame(0)">仓库页</button>
        <button onclick="changeFrame(1)">物流页</button>
    </p>
    <div>
        <iframe src="child.html" frameborder="0" id="warehouse"></iframe>
        <iframe src="grandson.html" frameborder="0" id="logistic"></iframe>
    </div>
</body>
<script>
    let frameArr = document.getElementsByTagName("iframe")
    console.log(frameArr);
    function changeFrame(index) {
        for (let i = 0; i < frameArr.length; i++) {
                frameArr[i].style.display = "none"
        }
        frameArr[index].style.display = "inline-block"
    }
</script>
<style>
    #warehouse,
    #logistic {
        display: none;
    }
</style>

</html>